﻿using System.Collections.Generic;
using YanZhiwei.DotNet2.Utilities.Base;
namespace YanZhiwei.DotNet2.Utilities.Common
{
    /// <summary>
    /// List帮助类
    /// </summary>
    public static class ListHelper
    {
        #region 转换为线程安全的ThreadSafeList集合
        /// <summary>
        ///转换为线程安全的ThreadSafeList集合
        /// </summary>
        /// <typeparam name="T">泛型</typeparam>
        /// <param name="self">需要操作的集合</param>
        /// <returns>ThreadSafeList集合</returns>
        public static ThreadSafeList<T> ToThreadSafeList<T>(this IEnumerable<T> self)
        {
            ThreadSafeList<T> _toSafeList = new ThreadSafeList<T>(self);
            return _toSafeList;
        }
        #endregion 
    }
}